<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8" />
	<title>千郡医疗-我的预约</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" th:href="@{/weixin/css/style.css}" />
	<link rel="stylesheet" th:href="@{/weixin/css/dropload.css}" />
    <script type="text/javascript"  th:src="@{/weixin/js/adaptive.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/fastclick.min.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/zepto.min.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/dropload.min.js}"></script>
</head>
<body>
	<section class="bespoke">
		<section class="recordBox">
			<ul class="list">
				
			</ul>
		</section>
		<a th:href="@{/weixin/book/add}" class="comBtn">新增预约</a>
	</section>
</body>
<script type="text/javascript">
/*<![CDATA[*/
$(function(){
	page = 0;
    $('.recordBox').dropload({
	    //scrollArea : window,
	    autoLoad : true,//自动加载
	    loadDownFn : function(me){
	     window.history.pushState(null, document.title, window.location.href);
	        $.ajax({
	            type: 'GET',
	            url:'/qianjun/weixin/book/list?page='+page,
	            dataType: 'json',
	            success: function(data){
	                if(data.content.length == 0){
	                    me.lock();
	                    me.noData();
	                    me.resetload();
	                    return;
	                }

			        var result = '';
	                for(var i=0; i< data.content.length; i++){
	                  result+=content(data.content[i]);
	                }
	                
	                $('.list').append(result);
	                page++;
	                me.resetload();
	            },
	            error: function(xhr, type){
	                alert('Ajax error!');
	                me.resetload();
	            }
	        });
	    }
	});
});

function content(data){
	return'<li><p class="name">'+data.productName+'</p><time>'+data.bookDate+'</time></li>';
}


/*]]>*/
</script>
</html>